
package com.platform.server.controller;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.paltform.server.entity.ExcelExpend;
import com.paltform.server.entity.ExcelPayments;
import com.platform.server.dao.ExpendDao;
import com.platform.server.service.ExpendService;
import com.platform.server.service.SkillService;
import com.platform.server.service.VipService;
import com.platform.server.util.ExportExcel;
import com.platform.server.util.StringTools;

@Controller
public class ExpendController {
	
	@Autowired
	private ExpendService expendService;
	
	@Autowired
	private VipService vipService;
	
	@Autowired
	private ExpendDao expendDao;
	
	@Autowired
	private SkillService skillService;	
	
	/**
	 * 支出统计
	 */
	@RequestMapping("/selectExpendList")
	public Object selectExpendList(HttpServletRequest request,String startTime,String endTime,String mobile,String integral_rank,Integer type){
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		DecimalFormat df = new DecimalFormat("#.00");
		List<Map<String, Object>> lists  = new LinkedList<>();
		List<Map<String, Object>> order  = new LinkedList<>();
		List<Map<String, Object>> cancelOrder  = new LinkedList<>();
		List<Map<String, Object>> refund  = new LinkedList<>();
		if(type == null){
			lists = expendService.selectExpendList(startTime, endTime, mobile, integral_rank);
			cancelOrder = expendService.selectCancelOrder(mobile,integral_rank,"支出");
			order = expendService.selectCancelOrder(mobile,integral_rank,"完成");
			refund = expendService.selectCancelOrder(mobile,integral_rank,"退款");
		}else if(type == 1){
			order = expendService.selectCancelOrder(mobile,integral_rank,"完成");
		}else if(type == 2){
			lists = expendService.selectExpendList(startTime, endTime, mobile, integral_rank);
		}else if(type == 3){
			cancelOrder = expendService.selectCancelOrder(mobile,integral_rank,"支出");
		}else if(type == 4){
			refund = expendService.selectCancelOrder(mobile,integral_rank,"退款");
		}
		for(int i = 0;i < lists.size();i++){
			lists.get(i).put("orderType", "提现");
			lists.get(i).put("platform", lists.get(i).get("sum_price"));
		}
		for(int i = 0;i < order.size();i++){
			order.get(i).put("orderType", "已完成订单");
			order.get(i).put("platform", order.get(i).get("sum_price"));
		}
		for(int i = 0;i < cancelOrder.size();i++){
			cancelOrder.get(i).put("orderType", "已取消订单");
		}
		for(int i = 0;i < refund.size();i++){
			refund.get(i).put("orderType", "已退款订单");
			refund.get(i).put("platform", refund.get(i).get("sum_price"));
		}
		lists.addAll(order);
		lists.addAll(cancelOrder);
		lists.addAll(refund);
		Double sumMoney = 0D;
		for(int i = 0;i < lists.size();i++){
			lists.get(i).put("create_time", sdf.format(lists.get(i).get("create_time")));
			if(lists.get(i).get("platform") != null){
				sumMoney += Double.valueOf(lists.get(i).get("platform").toString());
			}
		}
		Collections.sort(lists, new Comparator<Map<String, Object>>() {
			public int compare(Map<String, Object> o1, Map<String, Object> o2) {
				return ((String) o2.get("create_time")).compareTo((String) o1.get("create_time"));
			}
		});
		request.setAttribute("lists",lists);
		request.setAttribute("nums",lists.size());
		request.setAttribute("sumMoney",df.format(sumMoney));
		return "/ui/expend/expend_list.jsp";
	}
	
/*	*//**
	 * 收入统计
	 *//*
	@RequestMapping("/selectIncomeList")
	public Object selectIncomeList(HttpServletRequest request,String startTime,String endTime,String mobile,String integral_rank,Integer type){
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		DecimalFormat df = new DecimalFormat("#.00");
		Double discount = expendDao.selectPlatformDiscount();
		List<Map<String, Object>> lists  = new LinkedList<>();
		List<Map<String, Object>> order  = new LinkedList<>();
		List<Map<String, Object>> vip  = new LinkedList<>();
		List<Map<String, Object>> cancelOrder  = new LinkedList<>();
		List<Map<String, Object>> withdraw  = new LinkedList<>();
		if(type == null){
			lists = expendService.selectIncomeList(startTime, endTime, mobile, integral_rank);
			order = expendService.selectRechargeOrder(mobile,integral_rank);
			vip = vipService.selectVipList(startTime, endTime, mobile, integral_rank);
			cancelOrder = expendService.selectCancelOrder(mobile,integral_rank,"收入");
			withdraw = expendService.selectWithdrawNopass(mobile,integral_rank);
		}else if(type == 2){
			//查看充值订单
			order = expendService.selectRechargeOrder(mobile,integral_rank);
		}else if(type == 3){
			//查看vip订单  
			vip = vipService.selectVipList(startTime, endTime, mobile, integral_rank);
		}else if(type == 1){
			lists = expendService.selectIncomeList(startTime, endTime, mobile, integral_rank);
		}else if(type == 4){
			cancelOrder = expendService.selectCancelOrder(mobile,integral_rank,"收入");
		}else if(type == 5){
			//查看提现不通过订单
			withdraw = expendService.selectWithdrawNopass(mobile,integral_rank);
		}
		for(int i = 0;i < lists.size();i++){
			lists.get(i).put("orderType", "服务订单");
			lists.get(i).put("platform", lists.get(i).get("reality_price"));
			Double service_charge = 0D;
			if(discount > 0){
				service_charge = Double.parseDouble(df.format(Double.valueOf(lists.get(i).get("sum_price").toString()) * (discount / 100)));
			}
			lists.get(i).put("service_charge", service_charge);
		}
		for(int i = 0;i < order.size();i++){
			order.get(i).put("orderType", "充值订单");
			order.get(i).put("platform", order.get(i).get("sum_price"));
		}
		for(int i = 0;i < vip.size();i++){
			vip.get(i).put("orderType", "会员订单");
			vip.get(i).put("platform", vip.get(i).get("sum_price"));
		}
		for(int i = 0;i < cancelOrder.size();i++){
			cancelOrder.get(i).put("orderType", "已取消订单");
		}
		for(int i = 0;i < withdraw.size();i++){
			withdraw.get(i).put("orderType", "提现不通过");
			withdraw.get(i).put("platform", withdraw.get(i).get("sum_price"));
		}
		lists.addAll(order);
		lists.addAll(vip);
		lists.addAll(cancelOrder);
		lists.addAll(withdraw);
		Double sumMoney = 0D;
		for(int i = 0;i < lists.size();i++){
			lists.get(i).put("create_time", sdf.format(lists.get(i).get("create_time")));
			if(lists.get(i).get("type") != null && lists.get(i).get("type").equals("1")){
				lists.get(i).put("type", "微信");
			}
			if(lists.get(i).get("type") != null && lists.get(i).get("type").equals("2")){
				lists.get(i).put("type", "支付宝");
			}
			if(lists.get(i).get("type") != null && lists.get(i).get("type").equals("3")){
				lists.get(i).put("type", "余额");
			}
			if(lists.get(i).get("platform") != null){
				sumMoney += Double.valueOf(lists.get(i).get("platform").toString());
			}
		}
		Collections.sort(lists, new Comparator<Map<String, Object>>() {
			public int compare(Map<String, Object> o1, Map<String, Object> o2) {
				return ((String) o2.get("create_time")).compareTo((String) o1.get("create_time"));
			}
		});
		request.setAttribute("lists",lists);
		request.setAttribute("nums",lists.size());
		request.setAttribute("sumMoney",df.format(sumMoney));
		return "/ui/expend/income_list.jsp";
	}*/
	
	/**
	 * 收支统计(zh)
	 */
	@RequestMapping("/selectIncomeList")
	public Object selectIncomeList(HttpServletRequest request,String startTime,String endTime,String serverName,String mobile,String orderId,String type, String serveraddres, String userType, String serverType, String payType){
/*		Map<String, Object> map = expendDao.sumPlatform();
		BigDecimal sumMoney = BigDecimal.ZERO;
		if(map.get("czMoney") != null){
			sumMoney = sumMoney.add(new BigDecimal(map.get("czMoney").toString()));
		}
		if(map.get("srMoney") != null){
			sumMoney = sumMoney.add(new BigDecimal(map.get("srMoney").toString()));
		} 
		if(map.get("sxfMoney") != null){
			sumMoney = sumMoney.add(new BigDecimal(map.get("sxfMoney").toString()));
		} 
		if(map.get("hyMoney") != null){
			sumMoney = sumMoney.add(new BigDecimal(map.get("hyMoney").toString()));
		}
		if(map.get("zcMoney") != null){
			sumMoney = sumMoney.subtract(new BigDecimal(map.get("zcMoney").toString()));
		}
		if(map.get("txMoney") != null){
			sumMoney = sumMoney.subtract(new BigDecimal(map.get("txMoney").toString()));
		}*/
/*	789/*	List<Map<String, Object>> list1 = new ArrayList<Map<String,Object>>();
		List<Map<String, Object>> list2 = new ArrayList<Map<String,Object>>();
		List<Map<String, Object>> list3 = new ArrayList<Map<String,Object>>();
		List<Map<String, Object>> list4 = new ArrayList<Map<String,Object>>();
		List<Map<String, Object>> list5 = new ArrayList<Map<String,Object>>();
		List<Map<String, Object>> list6 = new ArrayList<Map<String,Object>>();
		List<Map<String, Object>> list7 = new ArrayList<Map<String,Object>>();
		List<Map<String, Object>> orderlist = new ArrayList<Map<String,Object>>();*/
		
		 
		List<Map<String, Object>> lists = expendService.queryIncomeList(startTime, endTime, orderId ,serverName,mobile, type,  serveraddres,  userType,  serverType);
		for (int i = 0; i < lists.size(); i++) {
			if(!StringTools.isEmpty(payType)&&!payType.equals(lists.get(i).get("zfType"))){
				lists.remove(i);
				i--;
			}
		}
		/*for (int i = 0; i < lists.size(); i++) {
			if(lists.get(i).get("selectType").equals("预约预付")){
				list1.add(lists.get(i));
			}
			if(lists.get(i).get("selectType").equals("需求方服务违约金支出")){
				list2.add(lists.get(i));
			}
			if(lists.get(i).get("selectType").equals("服务方服务违约金支出")){
				list3.add(lists.get(i));
			}
			if(lists.get(i).get("selectType").equals("预付返还")){
				list4.add(lists.get(i));
			}
			if(lists.get(i).get("selectType").equals("服务方服务违约金收入")){
				list5.add(lists.get(i));
			}
            if(lists.get(i).get("selectType").equals("需求方服务违约金收入")){
            	list6.add(lists.get(i));
			}
            if(lists.get(i).get("selectType").equals("完成")){
            	list7.add(lists.get(i));
            }
            
		}
		for (int j = 0; j < list1.size(); j++) {
				orderlist.add(list1.get(j));
				for (int i = 0; i < list2.size(); i++) {
					if(list1.get(j).get("order_id").equals(list2.get(i).get("order_id")) && list2.get(i).get("selectType").equals("需求方服务违约金支出")){
						orderlist.add(list2.get(i));
					    break;
					}
				}
				for (int q = 0; q < list3.size(); q++) {
					if(list1.get(j).get("order_id").equals(list3.get(q).get("order_id")) && list3.get(q).get("selectType").equals("服务方服务违约金支出")){
						orderlist.add(list3.get(q));
						break;
					}
				}
				for (int w = 0; w < list4.size(); w++) {
					if(list1.get(j).get("order_id").equals(list4.get(w).get("order_id")) && list4.get(w).get("selectType").equals("预付返还")){
						orderlist.add(list4.get(w));
						break;
					}
				}
				for (int r = 0; r < list5.size(); r++) {
					if(list1.get(j).get("order_id").equals(list5.get(r).get("order_id")) && list5.get(r).get("selectType").equals("服务方服务违约金收入")){
						orderlist.add(list5.get(r));
						break;
					}
				}
				for (int t = 0; t < list6.size(); t++) {
					if(list1.get(j).get("order_id").equals(list6.get(t).get("order_id")) && list6.get(t).get("selectType").equals("需求方服务违约金收入")){
						orderlist.add(list6.get(t));
						break;
					}
				}
				for (int y = 0; y < list7.size(); y++) {
					if(list1.get(j).get("order_id").equals(list7.get(y).get("order_id")) && list7.get(y).get("selectType").equals("完成")){
						orderlist.add(list7.get(y));
						break;
					}
				}
		}*/
		if(lists.size() > 0){
			Collections.sort(lists, new Comparator<Map<String, Object>>() {
				public int compare(Map<String, Object> o1, Map<String, Object> o2) {
					return (o2.get("create_time").toString()).compareTo(o1.get("create_time").toString());
				}
			});
		}
		List<Map<String, Object>> listd = skillService.skillList(null,null,null,null,null);
		request.setAttribute("listd",listd);
		request.setAttribute("lists",lists);
		request.setAttribute("nums",lists.size());
		return "/ui/expend/income_list.jsp";
	}
	
	// 导出报表
	@RequestMapping("/incomExportExcel")
	public void exportExcelInInvoice(HttpServletResponse response,HttpServletRequest request,String startTime,String endTime,String serverName,String mobile,String orderId,String type, String serveraddres, String userType, String serverType, String payType){

		List<Object> list2 = new ArrayList<Object>();
		List<Map<String, Object>> lists = expendService.queryIncomeList(startTime, endTime, orderId ,serverName,mobile, type,  serveraddres,  userType,  serverType);
		for (int i = 0; i < lists.size(); i++) {
			if(!StringTools.isEmpty(payType)&&!payType.equals(lists.get(i).get("zfType"))){
				lists.remove(i);
				i--;
			}
		}
		if(lists.size() > 0){
			Collections.sort(lists, new Comparator<Map<String, Object>>() {
				public int compare(Map<String, Object> o1, Map<String, Object> o2) {
					return (o2.get("create_time").toString()).compareTo(o1.get("create_time").toString());
				}
			});
		}
		for(Map<String, Object> user:lists){
			ExcelPayments payments = new ExcelPayments();
			payments.setCreateTime(user.get("create_time"));
			payments.setOrderId(user.get("order_id"));
			payments.setUserName(user.get("username"));
			payments.setMobile(user.get("mobile"));
			payments.setIntegralRank(user.get("integral_rank"));
			if (user.get("vipId") == null) {
				payments.setVipId("普通会员");
			}else {
				payments.setVipId("VIP会员");
			}
			payments.setServerSubType(user.get("server_sub_type"));
			payments.setSumPrice(user.get("orderMoney") == null ? "0.0" : user.get("orderMoney"));
			payments.setUserMoney(user.get("user_money"));
			payments.setCoupon(user.get("coupon") == null ? "0.0" : user.get("coupon"));
			payments.setIntegral(user.get("integral") == null ? "0.0" : user.get("integral"));
			payments.setVipdDiscount(user.get("vip_discount") == null ? "0.0" : user.get("vip_discount"));
			payments.setRealityPrice(user.get("realityPrice"));
			payments.setGiveReward(user.get("give_reward") == null ? "0" : user.get("give_reward"));
			if(user.get("coupon") != null && !user.get("coupon").toString().equals("0") && !user.get("coupon").toString().equals("0.0") && user.get("integral") !=null && !user.get("integral").toString().equals("0")){
				payments.setZfType(user.get("zfType")+"+优惠券"+"+积分");
			}else if(user.get("coupon") != null && !user.get("coupon").toString().equals("0.0") && !user.get("coupon").toString().equals("0")){
				payments.setZfType(user.get("zfType")+"+优惠券");
			}else if(user.get("integral") !=null && !user.get("integral").toString().equals("0")){
				payments.setZfType(user.get("zfType")+"+积分");
			}else{
				payments.setZfType(user.get("zfType"));
			}
			payments.setExpireTime(user.get("expire_time"));
			payments.setSelectType(user.get("selectType"));
			if (user.get("selectType").toString().equals("预约预付") || user.get("selectType").toString().equals("需求方服务违约金支出") || user.get("selectType").toString().equals("充值余额") || user.get("selectType").toString().equals("服务方服务违约金支出") || user.get("selectType").toString().equals("会员")) {
				payments.setPayMentsMoney(user.get("szMoney"));
			}else{
				payments.setPayMentsMoney("-"+user.get("szMoney"));
			}
			payments.setSumMoney(user.get("platform_money")== null ? "0.0" : user.get("platform_money"));
			payments.setProceduresMoney(user.get("procedure_money")== null ? "0.0" : user.get("procedure_money"));
			list2.add(payments);
		}
		String[] titles = {"交易时间" , "订单号" , "昵称" , "手机号" , "用户等级" ,"会员类型" , "服务类型" , "金额" ,  "用户余额" , "优惠券" , "积分抵现" , "vip折扣" , "实付款" , "打赏" , "支付方式" , "VIP到期时间" , "类型" , "平台收支", "平台余额","手续费(按服务金额)"};
		ExportExcel.exportExcel("平台收支流水表.xls", titles, list2, response);
	}

	
/*	// 导出报表
	@RequestMapping("/incomExportExcel")
	public void exportExcelInInvoice(HttpServletResponse response){
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		DecimalFormat df = new DecimalFormat("#.00");
		Double discount = expendDao.selectPlatformDiscount();
		List<Object> list2 = new ArrayList<Object>();
		List<Map<String, Object>> lists = expendService.selectIncomeList(null, null, null, null);
		List<Map<String, Object>> order = expendService.selectRechargeOrder(null,null);
		List<Map<String, Object>> vip = vipService.selectVipList(null, null, null, null);
		List<Map<String, Object>> cancelOrder = expendService.selectCancelOrder(null,null,"收入");
		List<Map<String, Object>> withdraw = expendService.selectWithdrawNopass(null,null);
		for(int i = 0;i < lists.size();i++){
			lists.get(i).put("orderType", "服务订单");
			lists.get(i).put("platform", lists.get(i).get("reality_price"));
			Double service_charge = 0D;
			if(discount > 0){
				service_charge = Double.parseDouble(df.format(Double.valueOf(lists.get(i).get("sum_price").toString()) * (discount / 100)));
			}
			lists.get(i).put("service_charge", service_charge);
		}
		for(int i = 0;i < order.size();i++){
			order.get(i).put("orderType", "充值订单");
			order.get(i).put("platform", order.get(i).get("sum_price"));
		}
		for(int i = 0;i < vip.size();i++){
			vip.get(i).put("orderType", "会员订单");
			vip.get(i).put("platform", vip.get(i).get("sum_price"));
		}
		for(int i = 0;i < cancelOrder.size();i++){
			cancelOrder.get(i).put("orderType", "已取消订单");
		}
		for(int i = 0;i < withdraw.size();i++){
			withdraw.get(i).put("orderType", "提现不通过");
			withdraw.get(i).put("platform", withdraw.get(i).get("sum_price"));
		}
		lists.addAll(order);
		lists.addAll(vip);
		lists.addAll(cancelOrder);
		lists.addAll(withdraw);
		Double sumMoney = 0D;
		for(int i = 0;i < lists.size();i++){
			lists.get(i).put("create_time", sdf.format(lists.get(i).get("create_time")));
			if(lists.get(i).get("type") != null && lists.get(i).get("type").equals("1")){
				lists.get(i).put("type", "微信");
			}
			if(lists.get(i).get("type") != null && lists.get(i).get("type").equals("2")){
				lists.get(i).put("type", "支付宝");
			}
			if(lists.get(i).get("type") != null && lists.get(i).get("type").equals("3")){
				lists.get(i).put("type", "余额");
			}
			if(lists.get(i).get("platform") != null){
				sumMoney += Double.valueOf(lists.get(i).get("platform").toString());
			}
		}
		Collections.sort(lists, new Comparator<Map<String, Object>>() {
			public int compare(Map<String, Object> o1, Map<String, Object> o2) {
				return ((String) o2.get("create_time")).compareTo((String) o1.get("create_time"));
			}
		});
		for(Map<String, Object> user:lists){
			ExcelIncome userInfo = new ExcelIncome();
			userInfo.setCreateTime(user.get("create_time"));
			userInfo.setOrderNum(user.get("order_id"));
			userInfo.setName(user.get("username"));
			userInfo.setMobile(user.get("mobile"));
			userInfo.setLevel(user.get("integral_rank"));
			userInfo.setServerType(user.get("server_sub_type"));
			userInfo.setMoney(user.get("sum_price"));
			userInfo.setDiscount(user.get("coupon"));
			userInfo.setIntegral(user.get("integral"));
			userInfo.setVip(user.get("vip_discount"));
			userInfo.setPayment(user.get("reality_price"));
			userInfo.setReward(user.get("give_reward") == null? "0" : user.get("give_reward"));
			userInfo.setPayMethed(user.get("type"));
			userInfo.setEndTime(user.get("expire_time"));
			userInfo.setType(user.get("orderType"));
			userInfo.setPlatform(user.get("platform"));
			userInfo.setProcedure(user.get("service_charge"));
			list2.add(userInfo);
		}
		String[] titles = {"交易时间" , "订单号" , "昵称" , "手机号" , "用户等级" , "服务类型" , "金额" , "优惠券" , "积分抵现" , "vip折扣" , "实付款" , "打赏" , "支付方式" , "到期时间" , "类型" , "平台收入","手续费(按服务金额)"};
		ExportExcel.exportExcel("平台收入表.xls", titles, list2, response);
	}
*/
	// 导出报表
			@RequestMapping("/expendExportExcel")
			public void expendExportExcel(HttpServletResponse response){
				SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
				List<Object> list2 = new ArrayList<Object>();
				List<Map<String, Object>> lists = expendService.selectExpendList(null, null, null, null);
				List<Map<String, Object>> cancelOrder = expendService.selectCancelOrder(null,null,"支出");
				List<Map<String, Object>> order = expendService.selectCancelOrder(null,null,"完成");
				List<Map<String, Object>> refund = expendService.selectCancelOrder(null,null,"退款");
				for(int i = 0;i < lists.size();i++){
					lists.get(i).put("orderType", "提现");
					lists.get(i).put("platform", lists.get(i).get("sum_price"));
				}
				for(int i = 0;i < order.size();i++){
					order.get(i).put("orderType", "已完成订单");
					order.get(i).put("platform", order.get(i).get("sum_price"));
				}
				for(int i = 0;i < cancelOrder.size();i++){
					cancelOrder.get(i).put("orderType", "已取消订单");
				}
				for(int i = 0;i < refund.size();i++){
					refund.get(i).put("orderType", "已退款订单");
					refund.get(i).put("platform", refund.get(i).get("sum_price"));
				}
				lists.addAll(order);
				lists.addAll(cancelOrder);
				lists.addAll(refund);
				Double sumMoney = 0D;
				for(int i = 0;i < lists.size();i++){
					lists.get(i).put("create_time", sdf.format(lists.get(i).get("create_time")));
					if(lists.get(i).get("platform") != null){
						sumMoney += Double.valueOf(lists.get(i).get("platform").toString());
					}
				}
				Collections.sort(lists, new Comparator<Map<String, Object>>() {
					public int compare(Map<String, Object> o1, Map<String, Object> o2) {
						return ((String) o2.get("create_time")).compareTo((String) o1.get("create_time"));
					}
				});
				for(Map<String, Object> user:lists){
					ExcelExpend userInfo = new ExcelExpend();
					userInfo.setName(user.get("username"));
					userInfo.setMobile(user.get("mobile"));
					userInfo.setLevel(user.get("integral_rank"));
					userInfo.setUsername(user.get("real_name"));
					if(user.get("type") == null){
						userInfo.setWithdrawType("");
					}else if(user.get("type").equals("1")){
						userInfo.setWithdrawType("银行卡");
					}else{
						userInfo.setWithdrawType("支付宝");
					}
					userInfo.setMoney(user.get("sum_price"));
					userInfo.setBalance(user.get("balance"));
					userInfo.setOrderNum(user.get("order_id"));
					userInfo.setCreateTime(user.get("create_time"));
					userInfo.setType(user.get("orderType"));
					userInfo.setPlatform(user.get("platform"));
					list2.add(userInfo);
				}
				String[] titles = {"昵称" , "手机号" , "用户等级" , "真是姓名" , "提现方式" , "金额" , "账户余额" , "订单编号" , "交易时间" , "类型" , "平台支出"};
				ExportExcel.exportExcel("平台支出表.xls", titles, list2, response);
			}
}
